package com.qys.livesMall.shop.modal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.qys.livesMall.common.serial.LocalDateTimeToTimestampSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author
 * @since 2023-06-06
 */
@Data
@TableName("h2_shop_purchase_info")
@Schema(name = "ShopPurchaseInfo", description = "")
public class ShopPurchaseInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "订单id")
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;
    @Schema(description = "店铺id")
    private Long shopId;
    @Schema(description = "数量合计")
    private Integer totalNum;

    @Schema(description = "金额合计")
    private BigDecimal moneys;

    @Schema(description = "实付金额")
    private BigDecimal actualPayAmount;


    @Schema(description = "支付类型，1、在线支付、0 货到付款")
    private String payType;

    @Schema(description = "订单创建时间")
    @JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private LocalDateTime createTime;

    @Schema(description = "订单更新时间")
    @JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private LocalDateTime updateTime;

    @Schema(description = "付款时间")
    @JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private LocalDateTime payTime;

    @Schema(description = "发货时间")
    @JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private LocalDateTime consignTime;

    @Schema(description = "交易完成时间")
    @JsonSerialize(using = LocalDateTimeToTimestampSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private LocalDateTime endTime;

    @Schema(description = "用户名称")
    private String username;

    @Schema(description = "交易流水号")
    private String transactionId;

    @Schema(description = "订单状态,0:未完成,1:已完成，2：已退货")
    private String orderStatus;

    @Schema(description = "支付状态,0:未支付，1：已支付，2：支付失败")
    private String payStatus;

    @Schema(description = "是否删除")
    private String isDelete;
}
